// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 获取原始订单列表 */
export async function getOrderList(params: API.Original.OriginalParams) {
  return request('/api/initialOrder', {
    method: 'GET',
    params,
  });
}

/** 获取原始订单列表下拉框 */
export async function getOrderSelect() {
  return request('/api/initialOrder/select', {
    method: 'GET',
  });
}

/** 添加原始订单列表 */
export async function addOrder(data: API.Original.OriginalData) {
  return request('/api/initialOrder/add', {
    method: 'POST',
    data,
  });
}

/** 修改原始订单列表 */
export async function updateOrder(data: API.Original.OriginalData) {
  return request('/api/initialOrder/update', {
    method: 'POST',
    data,
  });
}
/** 删除原始订单列表 */
export async function deleteOrder(id: number) {
  return request('/api/initialOrder/delete', {
    method: 'DELETE',
    params: { id },
  });
}

/** 获取我的原始订单列表 */
export async function getMyOriginOrder() {
  return request('/api/initialOrder/getMyOriginOrder', {
    method: 'GET',
  });
}

/** 订单标记 */
export async function marksOriginOrder(params: { id: number; mark: string }) {
  return request('/api/initialOrder/mark', {
    method: 'GET',
    params,
  });
}

/** 获取我的完成订单列表 */
export async function getMyFinishOriginOrder() {
  return request('/api/initialOrder/getMyFinishOriginOrder', {
    method: 'GET',
  });
}

/** 获取我的设计分类 */
export async function getPieOriginOrder() {
  return request('/api/initialOrder/getPieOriginOrder', {
    method: 'GET',
  });
}

/** 获取我的设计表头 */
export async function getMyOriginOrderNum() {
  return request('/api/initialOrder/getMyOriginOrderNum', {
    method: 'GET',
  });
}

/** 修改订单状态 */
export async function updateStatus(params: { id: number; status: '0' | '1' }) {
  return request('/api/initialOrder/updateStatus', {
    method: 'GET',
    params,
  });
}

/** 报价 */
export async function quotation(params: { id: number; money: number }) {
  return request('/api/initialOrder/Quotation', {
    method: 'GET',
    params,
  });
}

/** 下单 */
export async function pushOrder(id: number) {
  return request('/api/initialOrder/pushOrder', {
    method: 'GET',
    params: { id },
  });
}
